home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 April / enter-2004-04.iso / files / httrack-3.30.exe / {app} / src / htsopt.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-10-11  |  8.1 KB  |  201 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31.  
  32. /* ------------------------------------------------------------ */
  33. /* File: HTTrack parameters block                               */
  34. /*       Called by httrack.h and some other files               */
  35. /* Author: Xavier Roche                                         */
  36. /* ------------------------------------------------------------ */
  37.  
  38.  
  39. #ifndef HTTRACK_DEFOPT
  40. #define HTTRACK_DEFOPT
  41.  
  42. #include <stdio.h>
  43. #include "htsbasenet.h"
  44. #include "htsbauth.h"
  45.  
  46. // structure proxy
  47. typedef struct {
  48.   int active;
  49.   char name[1024];
  50.   int port;
  51.   char bindhost[256];   // bind this host
  52. } t_proxy; 
  53.  
  54. /* Structure utile pour copier en bloc les paramΦtres */
  55. typedef struct {
  56.   char***  filters;
  57.   int*     filptr;
  58.   //int*    filter_max;
  59. } htsfilters;
  60.  
  61. /* Structure Θtat du miroir */
  62. typedef struct {
  63.   int stop;
  64.   int exit_xh;
  65.   int back_add_stats;
  66.   /* */
  67.   int mimehtml_created;
  68.   char mimemid[256];
  69.   FILE* mimefp;
  70. } htsoptstate;
  71.  
  72.  
  73. // paramΦtres httrack (options)
  74. typedef struct {
  75.   int wizard;       // wizard aucun/grand/petit
  76.   int flush;        // fflush sur les fichiers log
  77.   int travel;       // type de dΘplacements (same domain etc)
  78.   int seeker;       // up & down
  79.   int depth;        // nombre de niveaux de rΘcursion
  80.   int extdepth;     // nombre de niveaux de rΘcursion α l'ΘxtΘrieur
  81.   int urlmode;      // liens relatifs etc   
  82.   int debug;        // mode dΘbug log
  83.   int getmode;      // sauver html, images..
  84.   FILE* log;        // fichier log
  85.   FILE* errlog;     // et erreur
  86.   LLint maxsite;        // taille max site
  87.   LLint maxfile_nonhtml; // taille max non html
  88.   LLint maxfile_html;   // taille max html
  89.   int maxsoc;           // nbre sockets
  90.   LLint fragment;       // fragmentation d'un site
  91.   int nearlink;         // prendre les images/data proche d'une page mais α l'extΘrieur
  92.   int makeindex;        // faire un index
  93.   int kindex;           // et un index 'keyword'
  94.   int delete_old;       // effacer anciens fichiers
  95.   int timeout;          // nombre de secondes de timeout
  96.   int rateout;          // nombre d'octets minium pour le transfert
  97.   int maxtime;          // temps max en secondes
  98.   int maxrate;          // taux de transfert max
  99.   int maxconn;          // nombre max de connexions/s
  100.   int waittime;         // dΘmarrage programmΘ
  101.   int cache;            // gΘnΘration d'un cache
  102.   //int aff_progress;     // barre de progression
  103.   int shell;            // gestion d'un shell par pipe stdin/stdout
  104.   t_proxy proxy;        // configuration du proxy
  105.   int savename_83;      // conversion 8-3 pour les noms de fichiers
  106.   int savename_type;    // type de noms: structure originale/html-images en un seul niveau
  107.   char savename_userdef[256];  // structure userdef (ex: %h%p/%n%q.%t)
  108.   int mimehtml;         // MIME-html
  109.   int user_agent_send;  // user agent (ex: httrack/1.0 [sun])
  110.   char user_agent[128];
  111.   char path_log[1024];  // chemin pour cache et log
  112.   char path_html[1024]; // chemin pour miroir
  113.   char path_bin[1024];  // chemin pour templates
  114.   int retry;            // nombre d'essais supplΘmentaires en cas d'Θchec
  115.   int makestat;         // mettre α jour un fichier log de statistiques de transfert
  116.   int maketrack;        // mettre α jour un fichier log de statistiques d'opΘrations
  117.   int parsejava;        // parsing des classes java pour rΘcupΘrer les class, gif & cie
  118.   int hostcontrol;      // abandon d'un host trop lent etc.
  119.   int errpage;          // gΘnΘrer une page d'erreur en cas de 404 etc.
  120.   int check_type;       // si type inconnu (cgi,asp,/) alors tester lien (et gΘrer moved Θventuellement)
  121.   int all_in_cache;     // tout mettre en cache!
  122.   int robots;           // traitement des robots
  123.   int external;         // pages externes->pages d'erreur
  124.   int passprivacy;      // pas de mot de pass dans les liens externes?
  125.   int includequery;     // include la query-string
  126.   int mirror_first_page; // miroir des liens
  127.   char sys_com[2048];   // commande systΦme
  128.   int sys_com_exec;     // executer commande 
  129.   int accept_cookie;    // gestion des cookies
  130.   t_cookie* cookie;
  131.   int http10;           // forcer http 1.0
  132.   int nokeepalive;      // pas de keep-alive
  133.   int nocompression;    // pas de compression
  134.   int sizehack;         // forcer rΘponse "mis α jour" si taille identique
  135.   int urlhack;          // force "url normalization" to avoid loops
  136.   int tolerant;         // accepter content-length incorrect
  137.   int parseall;         // essayer de tout parser (tags inconnus contenant des liens, par exemple)
  138.   int norecatch;        // ne pas reprendre les fichiers effacΘs localement par l'utilisateur
  139.   int verbosedisplay;   // animation textuelle
  140.   char footer[256];     // ligne d'infos
  141.   int maxcache;         // maximum en mΘmoire au niveau du cache (backing)
  142.   //int maxcache_anticipate; // maximum de liens α anticiper (majorant)
  143.   int ftp_proxy;        // proxy http pour ftp
  144.   char filelist[1024];  // fichier liste URL α inclure
  145.   char urllist[1024];   // fichier liste de filtres α inclure
  146.   htsfilters filters;   // contient les pointeurs pour les filtres
  147.   void* hash;           // hash structure
  148.   void* robotsptr;         // robots ptr
  149.   char lang_iso[64];    // en, fr ..
  150.   char mimedefs[2048];  // ext1=mimetype1\next2=mimetype2..
  151.   //
  152.   int maxlink;          // nombre max de liens
  153.   int maxfilter;        // nombre max de filtres
  154.   //
  155.   char* exec;           // adresse du nom de l'Θxecutable
  156.   //
  157.   int quiet;            // poser des questions autres que wizard?
  158.   int keyboard;         // vΘrifier stdin
  159.   //
  160.   int is_update;        // c'est une update (afficher "File updated...")
  161.   int dir_topindex;     // reconstruire top index par la suite
  162.   //
  163.   htsoptstate state;    // Θtat
  164. } httrackp;
  165.  
  166. // stats for httrack
  167. typedef struct {
  168.   LLint HTS_TOTAL_RECV;      // flux entrant reτu
  169.   LLint stat_bytes;          // octets Θcrits sur disque
  170.   // int HTS_TOTAL_RECV_STATE;  // status: 0 tout va bien 1: ralentir un peu 2: ralentir 3: beaucoup
  171.   TStamp stat_timestart;     // dΘpart
  172.   //
  173.   LLint total_packed;        // flux entrant compressΘ reτu
  174.   LLint total_unpacked;      // flux entrant compressΘ reτu
  175.   int   total_packedfiles;   // fichiers compressΘs
  176.   //
  177.   TStamp istat_timestart[2];   // dΘpart pour calcul instantannΘ
  178.   LLint  istat_bytes[2];       // calcul pour instantannΘ
  179.   TStamp istat_reference01;    // top dΘpart donnΘ par #0 α #1
  180.   int    istat_idlasttimer;    // id du timer qui a rΘcemment donnΘ une stat
  181.   //
  182.   int stat_files;            // nombre de fichiers Θcrits
  183.   int stat_updated_files;    // nombre de fichiers mis α jour
  184.   //
  185.   int stat_nrequests;        // nombre de requΩtes sur socket
  186.   int stat_sockid;           // nombre de sockets allouΘes au total
  187.   int stat_nsocket;          // nombre de sockets
  188.   int stat_errors;           // nombre d'erreurs
  189.   int stat_errors_front;     // idem, mais au tout premier niveau
  190.   int stat_warnings;         // '' warnings
  191.   int stat_infos;            // '' infos
  192.   int nbk;                   // fichiers anticipΘs en arriΦre plan et terminΘs
  193.   LLint nb;                  // donnΘes transfΘrΘes actuellement (estimation)
  194.   //
  195.   LLint rate;
  196. } hts_stat_struct;
  197.  
  198.  
  199. #endif
  200.  
  201.